<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('商编查询')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>商户编号：</label>
                                <input type="text" name="bno"/>
                            </li>
                            <li>
                                <label>商户名称：</label>
                                <input type="text" name="note"/>
                            </li>
                            <li>
                                <label>商户状态：</label>
                                <input type="text" name="status"/>
                            </li>
                            <li>
                                <label>费率类型：</label>
                                <input type="text" name="rateType"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">

                <a class="btn btn-success" onclick="uploadMerchant(1)" shiro:hasPermission="ReportMerchant:uploadMerchant">
                    <i class="fa fa-upload"></i> 商编导入
                </a>
                <a class="btn btn-success" onclick="uploadMerchant(2)" shiro:hasPermission="ReportMerchant:uploadMerchant">
                    <i class="fa fa-upload"></i> 特殊商编导入
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "ReportMerchant";

        $(function() {
            var options = {
                url: prefix + "/queryMerchantList",
                clickToSelect: true,
                modalName: "商编查询",
                columns: [
                {
                    field: 'tbId',
                    title: '渠道编号'
                },
                {
                    field: 'bid',
                    title: '通道编号'
                },
                {
                    field: 'bno',
                    title: '渠道商户编号'
                },
                {
                    field: 'bankBno',
                    title: '渠道真实商户'
                },
                {
                    field: 'note',
                    title: '商户名称'
                },
                {
                    field: 'status',
                    title: '状态'
                },
                {
                    field: 'bankType',
                    title: '通道类型',
                    formatter: function (value, row, index) {
                        if (value == "1") {
                            return '<span style="color:blue;">本行</span>';
                        } else if (value == "2") {
                            return '<span style="color:green;">跨行</span>';
                        }
                    }
                },
                {
                    field: 'rateType',
                    title: '费率类型',
                    formatter: function (value, row, index) {
                        if (value == "4") {
                            return '<span style="color:blue;">优惠类</span>';
                        } else if (value == "5") {
                            return '<span style="color:green;">标准类</span>';
                        }
                    }
                },
                {
                    field: 'localLevel',
                    title: '优先级别'
                },
                {
                    field: 'standardRate',
                    title: '借记卡标准',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value, 4);
                    }
                },
                {
                    field: 'countSerial',
                    title: '通道交易上限笔数'
                },
                {
                    field: 'nowCountSerial',
                    title: '通道当日交易现有笔数'
                },
                {
                    field: 'sumMoney',
                    title: '通道交易上限金额',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'nowSumMoney',
                    title: '通道当日交易现有金额',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'minMoney',
                    title: '通道允许的最小金额',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'maxMoney',
                    title: '通道允许的最大金额',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'singleRate',
                    title: '贷记卡标准',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value, 4);
                    }
                },
                {
                    field: 'supportedCard',
                    title: '支持的卡类型',
                    formatter: function (value, row, index) {
                        if (value == "0") {
                            return '<span style="color:blue;">全部支持</span>';
                        } else if (value == "1") {
                            return '<span style="color:green;">仅支持磁条卡</span>';
                        } else if (value == "2") {
                            return '<span style="color:green;">仅支持IC卡</span>';
                        }
                    }
                },
                {
                    field: 'singleMoney',
                    title: '贷记卡封顶',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'borrowCard',
                    title: '支持的借贷记卡',
                    formatter: function (value, row, index) {
                        if (value == "0") {
                            return '<span style="color:blue;">全部支持</span>';
                        } else if (value == "1") {
                            return '<span style="color:green;">仅支持借记卡</span>';
                        } else if (value == "2") {
                            return '<span style="color:green;">仅支持贷记卡</span>';
                        }
                    }
                },
                {
                    field: 'standardMoney',
                    title: '借记卡封顶',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'isLoad',
                    title: '加载状态',
                    formatter: function (value, row, index) {
                        if (value == "0") {
                            return '<span style="color:blue;">未加载</span>';
                        } else if (value == "1") {
                            return '<span style="color:green;">已加载</span>';
                        }
                    }
                },
                {
                    field: 'isUser',
                    title: '所属商编池'
                },
                {
                    field: 'afterH',
                    title: '可交易前时间'
                },
                {
                    field: 'beforeH',
                    title: '可交易后时间'
                },
                {
                    field: 'beforeHour',
                    title: '可交易前时间'
                },
                {
                    field: 'afterHour',
                    title: '可交易后时间'
                },
                {
                    field: 'isMis',
                    title: '是否支持双免',
                    formatter: function (value, row, index) {
                        if (value == "0") {
                            return '<span style="color:blue;">支持</span>';
                        } else if (value == "1") {
                            return '<span style="color:green;">不支持</span>';
                        }
                    }
                },
                {
                    field: 'mcc',
                    title: '行业码'
                },
                {
                    field: 'area',
                    title: '省'
                },
                {
                    field: 'areaS',
                    title: '市'
                },
                {
                    field: 'areaQ',
                    title: '区'
                },
                {
                    field: 'remarks',
                    title: '备注(原因)'
                }]
            };
            $.table.init(options);
        });


        function uploadMerchant(source) {
            $.modal.open("上传文件资料", prefix + "/uploadMerchant?source=" + source,650,350);
        }
    </script>
</body>
</html>